# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-gensim
pkgname=('python2-gensim' 'python-gensim')
_pkgname=gensim
pkgver=4.3.3
pkgrel=2
pkgdesc='Python framework for fast Vector Space Modelling.'
arch=('any')
url='https://pypi.org/project/gensim/#files'
license=('LGPL')
makedepends=('python2-setuptools' 'python-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('8d8bf270df4c0b4df43de29c6cc00f566afd713a7230fa206e23def0e7e48eb37b9719284a6b28ff29d0b40fb3e0fe326fbb46f4817c680760d428d62eaa6aa8')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-gensim() {
  depends=('python2' 'python2-numpy' 'python2-scipy' 'python2-smart-open')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-gensim() {
  depends=('python' 'python-numpy' 'python-scipy' 'python-smart-open')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

